package org.csu.demopetstore.Service;

import org.csu.demopetstore.Persistence.AccountMapper;
import org.csu.demopetstore.entity.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountService {

    @Autowired
    private AccountMapper accountMapper;

    public Account login(String username,String password){
        return accountMapper.getAccountByUsernameAndPassword(username,password);
    }

    public Account getAccountInformation(String username){
        return accountMapper.getAccountInformation(username);
    }

    public void updateAccount(Account account){
        accountMapper.updateAccount(account);
    }
    public void updateProfile(Account account){
        accountMapper.updateProfile(account);
    }
    public void updateSignon(Account account){
        accountMapper.updateSignon(account);
    }

    public void insertAccount(Account account){
        accountMapper.insertAccount(account);
    }
    public void insertProfile(Account account){
        accountMapper.insertProfile(account);
    }
    public void insertSignon(Account account){
        accountMapper.insertSignon(account);
    }
}
